package com.booking.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.booking.bean.Sellerusers;
import com.booking.bean.Users;
import com.booking.dao.UserDAO;
import com.booking.dao.impl.UserDAOImpl;
import com.booking.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	
	@Autowired
	private UserDAO userDao ;
 
	//用户注册  
	@Override
	public String saveUser(Users user){ 
		String regUser = userDao.createUser(user);
		return regUser; 
	} 
	//用户修改
	@Override
	public Users updateUser(Users user){ 
		Users upUser = userDao.updateUser(user);
		return upUser; 
	} 
	 
	//用户登录 
	@Override
	public Users login(Users user) {
		Users exeitUser = userDao.queryUser(user);
		return exeitUser;
	}
	@Override
	public Sellerusers login(Sellerusers user) {
		Sellerusers exeitUser = userDao.queryUser(user);
		return exeitUser;
	}

}
